package org.erepublik.company.comparators;

import java.util.Comparator;

import org.erepublik.company.CountryData;

public class CountryDataComparatorByName implements Comparator<CountryData>  {

    @Override
    public int compare(CountryData o1, CountryData o2) {
        if (o1.getCountry()== null)
            return -1;
        if (o2.getCountry()== null)
            return 1;       
        
        return o1.getCountry().toString().compareTo(o2.getCountry().toString()) ;
    }

}